Python Program to Check Perfect Number